<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center userhome_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub userhome_fd0_0'>
          <view class='flex flex-wrap align-center userhome_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  userhome_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
          </view>
          <view class='flex flex-wrap align-center justify-end userhome_fd0_0_c0'>
          </view>
        </view>

      </view>
      <!-- <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view> -->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center userhome_flex_1">
        <view class='flex flex-wrap align-center userhome_fd1_0'>
          <image class='userhome_fd1_0_c0' mode="aspectFill" :src='info.avatar'></image>
          <text class='userhome_fd1_0_c1'>{{info.nickname}}</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout userhome_flex_2">
        <view class='flex flex-wrap align-center'>
          <view class='flex flex-direction align-center self-center justify-center userhome_fd2_0_c0'>
            <text class='userhome_fd2_0_c0_c0'>{{info.fans_num}}</text>
            <text class='userhome_fd2_0_c0_c1'>粉丝</text>
          </view>
          <view class='flex flex-direction align-center self-center justify-center userhome_fd2_0_c0'>
            <text class='userhome_fd2_0_c0_c0'>{{info.follow_num}}</text>
            <text class='userhome_fd2_0_c0_c1'>关注</text>
          </view>
        </view>
        <text class='userhome_fd2_1'>{{info.autograph}}</text>
        <view class='flex flex-wrap align-center justify-between' v-if="userInfo.id!=info.id">
          <view class='flex align-center self-center justify-center userhome_fd2_2_c0' @click.stop="collect">
            <image class='userhome_fd2_2_c0_c0' mode="aspectFill" :src='STATIC_URL+"173.png"'></image>
            <text class='userhome_fd2_2_c0_c1'>{{info.is_follow ? '已关注' : '关注'}}</text>
          </view>
          <view class='flex align-center self-center justify-center userhome_fd2_2_c0 ' @click.stop="gochat">
            <image class='userhome_fd2_2_c0_c0' mode="aspectFill" :src='STATIC_URL+"174.png"'></image>
            <text class='userhome_fd2_2_c0_c1'>私信</text>
          </view>
        </view>
        <view>
          <benben-flex-tabs class-name='userhome_benbenTabsfd2_3' v-model="tabsTypefd2_3" ref="benben_tabsfd2_3"
            select-mark="benben_tabsfd2_3" key="benben_tabsfd2_3" :open-title-type='false' :open-sticky='true' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd2_3">

            <scroll-view @scroll="tabsInfofd2_3.scrollX = $event.detail.scrollLeft" id="benben_tabsfd2_3"
              class="benben-tabs" style="width:686rpx" :scroll-x="true" :scroll-left.sync="tabsInfofd2_3.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd2_3-content">
                <view id="benben_tabsfd2_3-title" class="benben-tabs-title flex flex align-center justify-around">
                  <view :class="{ 'checkTitlefd2_3': tabsTypefd2_3 == '1', 'flex flex-wrap align-center': true }"
                    @tap="chengTab('1')" :id="`benben_tabsfd2_3-title-item-${'1'}`">

                    <text>动态</text>

                  </view>
                  <view :class="{ 'checkTitlefd2_3': tabsTypefd2_3 == '2', 'flex flex-wrap align-center': true }"
                    @tap="chengTab('2')" :id="`benben_tabsfd2_3-title-item-${'2'}`">

                    <text>发明</text>

                  </view>
                  <view :class="{ 'checkTitlefd2_3': tabsTypefd2_3 == '3', 'flex flex-wrap align-center': true }"
                    @tap="chengTab('3')" :id="`benben_tabsfd2_3-title-item-${'3'}`">

                    <text>二手</text>

                  </view>
                </view>
                <view :style="{ left: tabsInfofd2_3.lineleft, maxWidth: tabsInfofd2_3.lineWidth ,}"
                  id="benben_tabsfd2_3-line" class="benben-tabs-line flex benben-flex-tabs-line userhome_linefd2_3">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center userhome_flex_3">
        <view class='flex flex-wrap align-center userhome_fd3_0' v-for="(item,index) in dataList" :key="index"
          @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/homePage/detail/detail?aid=${item.aid}`">
          <image class='userhome_fd3_0_c0' mode="aspectFill" :src='item.picture[0]'></image>
          <view class='flex flex-direction flex-wrap align-stretch userhome_fd3_0_c1'>
            <text class='userhome_fd3_0_c1_c0'>{{item.title}}</text>
            <view class='flex flex-wrap align-center justify-between userhome_fd3_0_c1_c1'>
              <text class='userhome_fd3_0_c1_c1_c0'>{{item.exhibition_name}}</text>
              <view class='flex flex-wrap align-center'>
                <text class='userhome_fd3_0_c1_c1_c1_c0'>{{item.viewcount}} 浏览</text>
              </view>
            </view>
          </view>
        </view>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    TUIConversationService
  } from '@tencentcloud/chat-uikit-engine';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd2_3": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "tabsTypefd2_3": "1",
        "aid": "",
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "dataList": [],
        info: ''
      };
    },
    computed: {
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      }
    },
    watch: {},
    onLoad(options) {
      let {
        aid
      } = options
      if (aid !== undefined) this.aid = aid
      this.getUser()
      this.gette698cbe11f907Func()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      gochat(item) {
        console.log('iii', item)
        TUIConversationService.switchConversation(`C2C${this.aid}`)
        uni.navigateTo({
          url: "/TUIKit/components/TUIChat/index"
        })
      },
      // post669b1d0232445
      collect() {
        this.$api.post(global.apiUrls.post669b1d0232445, {
          user_id: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.getUser()
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      getUser() {
        this.$api.post(global.apiUrls.post669b1a503be81, {
          user_id: this.aid
        }).then(res => {
          this.info = res.data.data
        })
      },
      chengTab(type) {
        this.tabsTypefd2_3 = type
        this.gette698cbe11f907Func()
      },
      //查询动态列表
      gette698cbe11f907Func() {
        this.minixPagingListsApi = global.apiUrls.post669b591378614;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          freetransactionclassification_id: this.tabsTypefd2_3,
          user_id: this.aid
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .userhome_flex_0 {
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
  }

  .userhome_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: var(--benbenFontColor3);
  }

  .userhome_fd0_0_c0 {
    width: 120rpx;
  }

  .userhome_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .userhome_flex_1 {
    background: url(image-path('209.png')) no-repeat;
    height: 400rpx;
    width: 750rpx;
    background-size: 100% auto;
  }

  .userhome_fd1_0_c1 {
    font-size: 36rpx;
    color: var(--benbenFontColor3);
    font-weight: 600;
  }

  .userhome_fd1_0_c0 {
    width: 152rpx;
    height: 152rpx;
    border-radius: 100rpx;
    margin: 0rpx 32rpx 0rpx 0rpx;
  }

  .userhome_fd1_0 {
    width: 702rpx;
    margin: 0rpx auto 0rpx auto;
  }

  .userhome_flex_2 {
    background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%);
    ;
    padding: 24rpx;
    background-size: 100% auto;
    border-radius: 24rpx 24rpx 0rpx 0rpx;
    position: relative;
    z-index: 9;
    margin: -80rpx 0rpx 0rpx 0rpx;
  }

  .userhome_linefd2_3 {
    background: url(image-path('161.png')) no-repeat;
    width: 50rpx;
    height: 10rpx;
    top: 70rpx;
    background-size: 100% auto !important;
  }

  .checkTitlefd2_3 {
    font-weight: 700 !important;
    font-size: 36rpx !important;
    color: #176BE8 !important;
  }

  ::v-deep .userhome_benbenTabsfd2_3 {
    width: 686rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
    color: var(--benbenFontColor2);
    font-size: 32rpx;
  }

  .userhome_fd2_2_c0_c1 {
    font-size: 24rpx;
  }

  .userhome_fd2_2_c0_c0 {
    width: 24rpx;
    height: 24rpx;
    margin: 0rpx 32rpx 0rpx 0rpx;
  }

  .userhome_fd2_2_c0 {
    background: #F8F8F8;
    border-radius: 8rpx 8rpx 8rpx 8rpx;
    width: 333rpx;
    height: 63rpx;
    line-height: 63rpx;
  }

  .userhome_fd2_1 {
    margin: 32rpx 0rpx 32rpx 0rpx;
    font-size: 24rpx;
  }

  .userhome_fd2_0_c0_c1 {
    color: var(--benbenFontColor2);
  }

  .userhome_fd2_0_c0_c0 {
    font-size: 36rpx;
  }

  .userhome_fd2_0_c0 {
    width: 200rpx;
  }

  .userhome_flex_3 {
    margin: 0rpx auto 0rpx auto;
    width: 702rpx;
  }

  .userhome_fd3_0_c1_c1_c1_c0 {
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
  }

  .userhome_fd3_0_c1_c1_c0 {
    font-weight: 600;
    color: rgba(255, 72, 59, 1);
  }

  .userhome_fd3_0_c1_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .userhome_fd3_0_c1_c0 {
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .userhome_fd3_0_c1 {
    margin: 24rpx auto 20rpx auto;
    width: 320rpx;
  }

  .userhome_fd3_0_c0 {
    width: 346rpx;
    height: 346rpx;
    border-radius: 16rpx 16rpx 0rpx 0rpx;
  }

  .userhome_fd3_0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    width: 346rpx;
    margin: 16rpx 0 0rpx 0rpx;
  }

  .userhome_fd3_0:nth-child(2n) {
    margin: 16rpx 0 0rpx 10rpx;
  }
</style>
